/** Copyright (c) 2015—2017 Zerone.Co.Ltd. All rights reserved. */
package com.zerone.facade.merchant.order;

import com.acooly.core.common.facade.OrderBase;
import com.acooly.core.utils.ToString;
import com.acooly.core.utils.validate.jsr303.MobileNo;
import com.zerone.facade.merchant.enums.MerchantTypeEnum;
import com.zerone.payment.common.facade.enums.CertTypeEnum;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Size;

/** @author glassescat <a href="">零一零一科技</a> */
@Setter
@Getter
public class MerchantRegisterOrder extends OrderBase {

  private static final long serialVersionUID = 3996581856235073909L;

  /** 上级商户ID */
  @Size(max = 20, message = "[上级商户ID]最大长度为{max}")
  private String parentMerchantId;

  /** 商户名称 */
  @NotBlank(message = "[商户名称]不能为空")
  @Size(max = 256, message = "[商户名称]最大长度为{max}")
  private String merchantName;

  /** 商户类型 */
  @NotBlank(message = "[商户类型]不能为空")
  private MerchantTypeEnum merchantType = MerchantTypeEnum.AGENT_MERCHANT;

  /** 联系人 */
  @NotBlank(message = "[联系人]不能为空")
  @Size(max = 32, message = "[联系人]最大长度为{max}")
  private String contact;

  /** 手机号 */
  @NotBlank(message = "[手机号]不能为空")
  @MobileNo(message = "[手机号]格式不合法")
  private String mobile;

  /** 邮箱 */
  @Email(message = "[邮箱]格式合法")
  @NotBlank(message = "[邮箱]不能为空")
  private String email;

  /** 营业执照号 */
  @NotBlank(message = "[营业执照号]不能为空")
  @Size(max = 128, message = "[营业执照号]最大长度为{max}")
  @ToString.Maskable
  private String licenceNo;

  /** 营业执照图片地址 */
  @Size(max = 256, message = "[营业执照图片地址]最大长度为{max}")
  private String licencePath;

  /** 经营范围 */
  @NotBlank(message = "[经营范围]不能为空")
  @Size(max = 512, message = "[经营范围]最大长度为{max}")
  private String busScope;

  /** 经营类目 */
  @Size(max = 512, message = "[经营类目]最大长度为{max}")
  private String category;

  /** 经营商品 */
  @Size(max = 1024, message = "[经营类目]最大长度为{max}")
  private String goods;

  /** 地址 */
  @Size(max = 512, message = "[地址]最大长度为{max}")
  private String address;

  /** 法人姓名 */
  @Size(max = 16, message = "[法人姓名]最大长度为{max}")
  private String legalName;

  /** 法人证件类型 */
  private CertTypeEnum legalCertType = CertTypeEnum.ID;

  /** 法人证件号 */
  @Size(max = 32, message = "[法人证件号]最大长度为{max}")
  private String legalCertNo;

  /** 法人证件正面图片地址 */
  @Size(max = 256, message = "[法人证件正面图片地址]最大长度为{max}")
  private String legalCertFrontPath;

  /** 法人证件反面图片地址 */
  @Size(max = 256, message = "[法人证件反面图片地址]最大长度为{max}")
  private String legalCertBackPath;

  /** 法人证件到期时间 */
  @Size(max = 32, message = "[法人证件到期时间]最大长度为{max}")
  private String legalCertValidDate;

  @Override
  public String toString() {
    return ToString.toString(this);
  }
}
